Optimal. Leaf size=126 \[ \frac {4 a b \csc (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc ^2(c+d x)}{2 d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {\left (a^2-2 b^2\right ) \log (\sin (c+d x))}{d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2800, 962}
\begin {gather*} \frac {\left (2 a^2-b^2\right ) \csc ^2(c+d x)}{2 d}+\frac {\left (a^2-2 b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {2 a b \sin (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}+\frac {4 a b \csc (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 962
Rule 2800
Rubi steps
\begin {align*} \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^2}{x^5} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (2 a+\frac {a^2 b^4}{x^5}+\frac {2 a b^4}{x^4}+\frac {-2 a^2 b^2+b^4}{x^3}-\frac {4 a b^2}{x^2}+\frac {a^2-2 b^2}{x}+x\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {4 a b \csc (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc ^2(c+d x)}{2 d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {\left (a^2-2 b^2\right ) \log (\sin (c+d x))}{d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.48, size = 107, normalized size = 0.85 \begin {gather*} \frac {48 a b \csc (c+d x)+6 \left (2 a^2-b^2\right ) \csc ^2(c+d x)-8 a b \csc ^3(c+d x)-3 a^2 \csc ^4(c+d x)+6 \left (2 \left (a^2-2 b^2\right ) \log (\sin (c+d x))+4 a b \sin (c+d x)+b^2 \sin ^2(c+d x)\right )}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 157, normalized size = 1.25
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {\left (\cot ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+2 a b \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+b^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) | \(157\) |
default | \(\frac {a^{2} \left (-\frac {\left (\cot ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+2 a b \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+b^{2} \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) | \(157\) |
risch | \(-i a^{2} x +2 i b^{2} x -\frac {b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {i a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {i a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}-\frac {b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {2 i a^{2} c}{d}+\frac {4 i b^{2} c}{d}+\frac {2 i \left (6 i a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-3 i b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+12 a b \,{\mathrm e}^{7 i \left (d x +c \right )}-6 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-28 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+28 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-12 a \,{\mathrm e}^{i \left (d x +c \right )} b \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{d}\) | \(305\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 105, normalized size = 0.83 \begin {gather*} \frac {6 \, b^{2} \sin \left (d x + c\right )^{2} + 24 \, a b \sin \left (d x + c\right ) + 12 \, {\left (a^{2} - 2 \, b^{2}\right )} \log \left (\sin \left (d x + c\right )\right ) + \frac {48 \, a b \sin \left (d x + c\right )^{3} - 8 \, a b \sin \left (d x + c\right ) + 6 \, {\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{2} - 3 \, a^{2}}{\sin \left (d x + c\right )^{4}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 177, normalized size = 1.40 \begin {gather*} -\frac {6 \, b^{2} \cos \left (d x + c\right )^{6} - 15 \, b^{2} \cos \left (d x + c\right )^{4} + 6 \, {\left (2 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} - 9 \, a^{2} + 3 \, b^{2} - 12 \, {\left ({\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} - 2 \, b^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) - 8 \, {\left (3 \, a b \cos \left (d x + c\right )^{4} - 12 \, a b \cos \left (d x + c\right )^{2} + 8 \, a b\right )} \sin \left (d x + c\right )}{12 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \cot ^{5}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 8.73, size = 138, normalized size = 1.10 \begin {gather*} \frac {6 \, b^{2} \sin \left (d x + c\right )^{2} + 24 \, a b \sin \left (d x + c\right ) + 12 \, {\left (a^{2} - 2 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) - \frac {25 \, a^{2} \sin \left (d x + c\right )^{4} - 50 \, b^{2} \sin \left (d x + c\right )^{4} - 48 \, a b \sin \left (d x + c\right )^{3} - 12 \, a^{2} \sin \left (d x + c\right )^{2} + 6 \, b^{2} \sin \left (d x + c\right )^{2} + 8 \, a b \sin \left (d x + c\right ) + 3 \, a^{2}}{\sin \left (d x + c\right )^{4}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.44, size = 310, normalized size = 2.46 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {5\,a^2}{2}-2\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {23\,a^2}{4}-4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (3\,a^2+30\,b^2\right )-\frac {a^2}{4}+\frac {76\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {356\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{3}+92\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-\frac {4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}}{d\,\left (16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^2-2\,b^2\right )}{d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-2\,b^2\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {3\,a^2}{16}-\frac {b^2}{8}\right )}{d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12\,d}+\frac {7\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________